package com.snack.common.log4j;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import com.snack.common.db.DbHelper;

public class Log4jTest {
	static Logger log = Logger.getLogger(Log4jTest.class);
	public static void main(String[] args) {
		 DOMConfigurator.configureAndWatch("log4j.xml");
		 DbHelper.execute("insert into t_act_demo(name)values('你好')");
		 if(log.isInfoEnabled()){
			 log.info("info 级别内容"); 
		 }
		 
		 if(log.isDebugEnabled()){
			 log.debug("debug 级别内容"); 
		 } 
		 
		 try { 
		} catch (Exception e) {
			// TODO: handle exception 
			log.error("系统出错"+e); 
			e.printStackTrace();
		}
		  
	}
}
